<template>			
	<view v-if="isRegister"> 
		<view class="cu-bar bg-white solid-bottom margin-top-xs">
			<view class="action">
				<text class="cuIcon-title text-cyan"></text>请把身份证放在指定设备上检查
			</view>
		</view>
		<view class="flex justify-center bg-white">
			<image src="/static/images/OCR/idcard1.png" mode=""></image>
		</view>
		<form action="" class="text-grey">
			<view class="cu-form-group">
				<view class="title">姓名</view>
				<input type="text" v-model="userInfo.Name"></input>
			</view>
			<view class="cu-form-group">
				<view class="title">证件号</view>
				<input type="text" v-model="userInfo.IdentityNo"></input>
			</view>
			<view class="cu-form-group">
				<view class="title">签发机关</view>
				<input type="text"></input>
			</view>
			<view class="cu-form-group">
				<view class="title">有效期限</view>
				<input type="text"></input>
			</view>
			<view class="padding-xl">
				<button class="cu-btn block bg-blue lg" @click="reqUserInfo">身份证测试</button>
			</view>			
		</form>
	</view>
</template>

<script>
	let _this = null
	import { urlTobase64 } from "@/common/utils/common.js"
	import { faceRecognition } from '@/common/api/recognition.js'
	import { getUserInfo } from '@/common/api/user.js'
	export default {
		data() {
			return {
				userInfo: {
					Userid: '',
					IdentityNo: '371726199108057664',
					Name: '小明',
					IsLimit: true,
				},
				imageInfo: ''
			}
		},
		created () {
			_this = this;
			this.reqUserInfo()
		},
		methods: {
			
			// 请求用户信息
			reqUserInfo() {
				getUserInfo(this.userInfo).then(({data}) => {					
					if (data.msgcode == 1000) {
						// 可以创建网签
						if (data.data.IsLimit) {
							this.$store.commit('user/addUserList', data.data)
						} else {
							this.showToast('你没有权限登录')
						}
					} else {
						this.showToast(data.msg, 'none', 2000)
					}
				}).catch(err => {})
			}			
		}
	}
</script>

<style scoped>
.cu-form-group .title {
	min-width: calc(4em + 15px);
}
</style>
